<?php

	namespace app\index\behavior;

	use app\common\model\goods\record\Token;
	use app\common\model\goods\Product;
	use think\Log;

	class User{
		public function userRegisterSuccessed(&$user){
			$config = Product::config('token');

			// 赠送Token
			$amount = $config['register_gift'];
			Token::change($user->id,$amount,'注册赠送');

			// 赠送免费次数
			$user->free_times = config('site.reg_free_times');
			$user->save();
		}
	}